diff -Naur libX11-1.3.5//src/xlibi18n/ICWrap.c libX11-1.3.5.tpg//src/xlibi18n/ICWrap.c
--- libX11-1.3.5//src/xlibi18n/ICWrap.c	2010-08-10 04:59:44.000000000 +0000
+++ libX11-1.3.5.tpg//src/xlibi18n/ICWrap.c	2010-09-17 17:11:21.000000000 +0000
@@ -283,7 +283,7 @@
     XIMArg *args;
     char   *ret;
 
-    if (!ic->core.im)
+    if (!ic || !ic->core.im)
 	return (char *) NULL;
 
     /*
